package com.xmg.p2p.base.domain;

import java.util.Date;

import lombok.Getter;
import lombok.Setter;

/**
 * 登陆日志
 * 
 * 
 */
@Setter
@Getter
public class Iplog extends BaseDomain {

	public static final int STATE_SUCCESS = 1;//登录成功
	public static final int STATE_FAILED = 0;//登录失败

	private String ip;//登陆的ip
	private Date loginTime;//登陆的时间
	private String userName;//登陆的用户
	private int state = STATE_SUCCESS ;//登陆的状态
	private int userType  ; //登陆的用户类型 (可以直接使用Logininfo里面的常量)

	public String getStateDisplay(){
		return state == STATE_SUCCESS ? "登陆成功" : "登陆失败" ;
	}

	public String getUserTypeDisplay(){
		return userType == Logininfo.USER_CLIENT ? "前端用户" : "后端管理员" ;
	}
	
	
}
